import { reqSearchList } from "@/api";
const state = {
    searchList:{}
}

const getters = {
    trademarkList(state) {
      return state.searchList.trademarkList;
    },
    attrsList(state) {
      return state.searchList.attrsList;
    },
    goodsList(state) {
      return state.searchList.goodsList;
    },
    totalPages(state){
      return state.searchList.totalPages
    },
    totals(state){
      return state.searchList.total
    },
  };
  const mutations = {
    SET_SEARCHLIST_STATE(state, payload) {
      state.searchList = payload.searchList;
    },
  };
  const actions = {
    async getSearchList({ commit }, searchParams) {
      const result = await reqSearchList(searchParams);
    //   console.log(result);
      commit("SET_SEARCHLIST_STATE", { searchList: result });
    },
  };
  export default {
    namespaced: true,
    state,
    getters,
    mutations,
    actions,
  };